Skip to content

smp agent: handle client/agent version downgrades after connection was established#1508

Merged
epoberezkin merged 1 commit into
masterfrom
ep/handle-agent-downgrade
Apr 10, 2025
Merged

smp agent: handle client/agent version downgrades after connection was established#1508
epoberezkin merged 1 commit into
masterfrom
ep/handle-agent-downgrade

Conversation

@epoberezkin
Copy link
Copy Markdown
Member

No description provided.

@epoberezkin epoberezkin requested a review from spaced4ndy as a code owner April 10, 2025 08:17
parseMessage msgBody
clientVRange <- asks $ smpClientVRange . config
unless (phVer `isCompatible` clientVRange) . throwE $ AGENT A_VERSION
unless (phVer `isCompatible` clientVRange || phVer <= agreedClientVerion) . throwE $ AGENT A_VERSION
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this fixes downgrade for established connections

unless
(agentVersion `isCompatible` smpAgentVRange && smpClientVersion `isCompatible` smpClientVRange)
(throwE $ AGENT A_VERSION)
-- checking agreed versions to continue connection in case of client/agent version downgrades
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this fixes downgrade during connection handshake

@epoberezkin epoberezkin force-pushed the ep/handle-agent-downgrade branch from c762fd2 to c95a405 Compare April 10, 2025 09:37
@epoberezkin epoberezkin merged commit 6dc9d76 into master Apr 10, 2025
2 of 3 checks passed
@epoberezkin epoberezkin deleted the ep/handle-agent-downgrade branch April 10, 2025 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant